---
title: 'Cypress.$ | Cypress Documentation'
description: Cypress automatically includes jQuery and exposes it as Cypress.$.
sidebar_label: Cypress.$
---

<ProductHeading product="app" />

# Cypress.$

Cypress automatically includes [jQuery](http://jquery.com) and exposes it as
`Cypress.$`.

This is a great way to _synchronously_ query for elements when debugging from
Developer Tools.

## Syntax

```javascript
Cypress.$(selector)

// other proxied jQuery methods
Cypress.$.Event
Cypress.$.Deferred
Cypress.$.ajax
Cypress.$.get
Cypress.$.getJSON
Cypress.$.getScript
Cypress.$.post
```

### Usage

<Icon name="check-circle" color="green" /> **Correct Usage**

```javascript
Cypress.$('p')
```

<Icon name="exclamation-triangle" color="red" /> **Incorrect Usage**

```javascript
cy.$('p') // Errors, cannot be chained off 'cy'
```

## Examples

### Selector

```javascript
const $li = Cypress.$('ul li:first')

cy.wrap($li)
  .should('not.have.class', 'active')
  .click()
  .should('have.class', 'active')
```

## Notes

### Cypress.$ vs. cy.$$

You can also query DOM elements with `cy.$$`. But `Cypress.$` and `cy.$$` are
different.

`Cypress.$` refers to the `jQuery` function itself. You can do anything with
`Cypress.$` if you can do it with the `jQuery` function. So, both of the
examples below work.

```js
Cypress.$.each([1, 2, 3], (index, value) => {
  expect(index).to.eq(value)
}) // works
```

```js
$.each([1, 2, 3], (index, value) => {
  expect(index).to.eq(value)
}) // also works
```

But `cy.$$` is a wrapper of the `jQuery.fn.init` function. In other words, you
can only query DOM elements with `cy.$$`. Because of that, the jQuery utility
functions like `jQuery.each`, `jQuery.grep` don't work with `cy.$$`.

```js
cy.$$.each([1, 2, 3], (index, value) => {
  expect(index).to.eq(value)
}) // fails
```

## See also

- [Bundled Libraries](/app/references/bundled-libraries)
